﻿Imports MySql.Data.MySqlClient

Public Class DBCommand
    Dim conn As MySqlConnection = New MySqlConnection()
    Public Sub New()
        conn.ConnectionString = "Data Source=localhost;Database=studiodietetico;User ID=root;"
    End Sub
    Public Function connect()
        Try
            conn.Open()
        Catch ex As Exception
            MsgBox("Impossibile connettersi al database", MsgBoxStyle.Critical)
        End Try
        Return conn
    End Function

    Public Sub disconnect()
        conn.Close()
    End Sub

End Class
